﻿<div class="spacing-bottom-sm row" page-header="Manage work orders">
    <div class="col-sm-6">
        <input class="form-control" ng-model="customer" placeholder="Customer" ui-keypress="{13:'search(customer)'}" autofocus
               typeahead-on-select="updateCustomer($item)" typeahead="customer as customer.name for customer in getCustomerList($viewValue)" />
    </div>
    <div class="col-sm-6">
        <a class="btn btn-info" ui-sref="workOrder-new">
            <b class="glyphicon glyphicon-plus"></b> New work order
        </a>
    </div>
</div>

<table ng-table="tableParams" class="table table-hover table-bordered ng-table-resizable-columns" ng-visible="$data.length">
    <tr ng-repeat="item in $data">
        <td data-title="'#'" header-class="col-sm-1 width10"><span class="form-control-static">{{item.workOrderNo}}</span></td>
        <td data-title="'PO #'" header-class="col-sm-2 width10"><span class="form-control-static">{{item.poNumber}}</span></td>
        <td data-title="'Calib Date'" header-class="col-sm-1 width10"><span class="form-control-static">{{item.calibrationDate | date: 'dd/MMM/yyyy'}}</span></td>
        <td data-title="'Customer'" header-class="col-sm-3 width50"><span class="form-control-static">{{item.companyName}}</span></td>
        <td data-title="'Salesman'" header-class="col-sm-2 width10"><span class="form-control-static">{{item.salesmanName}}</span></td>

        <td class="text-center" header-class="col-sm-1 width10">
            <a ui-sref="workOrder-item({id: item.workOrderId})" class="btn btn-default">View</a>
        </td>
    </tr>
</table>
<div ng-show="!tableParams.settings().$loading && tableParams.data.length === 0" class="well text-center">No result</div>
